﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using T.FAS.Runtime.Base.Dao;
using T.FAS.Runtime.ScheduleJob.SPI;
using T.ServiceComponent.DAC.Service;
using T.ServiceComponent.DataAccessEx.Core;

namespace T.FAS.Runtime.ScheduleJob.Dao
{
    public class SysFuncSetDao : DaoService<SysFuncSet>
    {
        public override string TableName => "FAS_SysFuncSet";
        public override string IDColumnName => "ID";

        public override List<string> ExceptColumnName
            => DaoUtil.GetExceptionColumn<SysFuncSetDao>(
                new List<string>
                {
                }
            );
        public SysFuncSetDao() : base()
        {
            DBName = "TFAS";
        }
        public override SysFuncSet ConvertToObject(Dictionary<string, PropertyInfo> columns, DataRow row)
        {
            var data = base.ConvertToObject(columns, row);
            return data;
        }
        public override Dictionary<string, object> GetDataMapping(SysFuncSet data)
        {
            var mapping = base.GetDataMapping(data);
            return mapping;
        }
        public override Dictionary<string, PropertyInfo> GetColumns()
        {
            return base.GetColumns();
        }

        public SysFuncSet GetSysFuncSetByFuncSetByType(string funcSetType)
        {
            var result = base.GetObjectsByFilter($"FuncSetType = '{funcSetType}'");
            if (result != null && result.Count > 0)
            {
                return result[0] as SysFuncSet;
            }
            return null;
        }
    }
}
